-
Notifications
You must be signed in to change notification settings - Fork 389
Adding reusable and composite action katas #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
michaelin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of problems in the action and the workflows in the lab that causes the workflow to fail. They should be fixed.
For readability and to reduce the risk of copy paste errors, I'd also like the print_summary_text script extracted into a separate file.
Other than that, it could be nice if the exercices follow the same template as the other exercises. Given the time until the first run, that is not a blocker, though.
michaelin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've extracted the formatting script into a separate script. I also added a missing output from the reusable action. Other than that, I've mainly made some minor style updates.
Co-authored-by: Michael Ingeman-Nielsen <[email protected]>
Co-authored-by: Michael Ingeman-Nielsen <[email protected]>
Co-authored-by: Michael Ingeman-Nielsen <[email protected]>
Co-authored-by: Michael Ingeman-Nielsen <[email protected]>
Co-authored-by: Michael Ingeman-Nielsen <[email protected]>
a4177eb to
f9e71e9
Compare
This pull request introduces a hands-on lab for creating and using composite actions and reusable workflows in GitHub Actions. The main additions are a Python helper script for summarizing a list of numbers, step-by-step markdown guides for building a composite action around this script, and instructions for composing it into reusable workflows and consumer jobs. These changes provide practical examples for learning how to pass inputs/outputs between actions and workflows.
Composite Action and Python Helper:
ci/print_summary.py, a Python script that reads a JSON array of numbers and prints a summary (count, sum, average, min, max); includes error handling for input validation.labs/composite-action.md, a lab guide explaining how to create a composite action that pipes numbers to the Python helper, exposes outputs, and is called from a workflow.Reusable Workflow and Consumer Example:
labs/reusable-2.md, a lab guide for building a reusable workflow that calls the composite action, formats the summary output, and exposes both JSON and human-readable outputs. Includes example consumer workflow and tips for testing.